package com.offer;


import com.utils.DataUtils;

public class Test58_1 {

    public String reverseWords(String s) {
        String[] strings = s.split(" ");

        StringBuilder stringBuilder = new StringBuilder();

        for (String string : strings) {
            if (string.equals("")) {
                continue;
            }
            stringBuilder.insert(0, " ").insert(0, string);
        }

        return stringBuilder.toString().trim();
    }

    public static void main(String[] args) {
        Test58_1 test = new Test58_1();

        System.out.println(test.reverseWords("the  sky is blue"));
    }

}
